# makefile for Symphony
#
# Note: Everything in the makefile is in alphabetical order, except
#       for command* documents, which are grouped logically.
# a m n o p r v
CC		= g++
FLAGS	= -ggdb3 -ansi -Wall -Werror -pedantic-errors
#FLAGS	= -O3
LIBS	= 
OBJECTS	=	obj/account.o			\
			obj/area.o				\
			obj/board.o				\
			obj/character.o			\
			obj/command.o			\
			obj/commands_A-F.o		\
			obj/commands_G-M.o		\
			obj/commands_N-P.o		\
			obj/commands_Q-S.o		\
			obj/commands_T-Z.o		\
			obj/commands_aedit.o	\
			obj/commands_medit.o	\
			obj/commands_pedit.o	\
			obj/commands_redit.o	\
			obj/commands_tedit.o	\
			obj/commandTable.o		\
			obj/creature.o			\
			obj/exit.o				\
			obj/help.o				\
			obj/log.o				\
			obj/loginHandler.o		\
			obj/main.o				\
			obj/mob.o				\
			obj/note.o				\
			obj/object.o			\
			obj/reset.o				\
			obj/room.o				\
			obj/socket.o			\
			obj/stringutil.o		\
			obj/tEditHandler.o		\
			obj/timer.o				\
			obj/timestamp.o			\
			obj/world.o

all: symphony

symphony: $(OBJECTS)
	rm -rf ./symphony
	$(CC) $(FLAGS) $(LIBS) $(OBJECTS) -o symphony

obj/account.o: src/definitions.h src/definitions.h src/account.h src/account.cpp
	$(CC) -c $(FLAGS) src/account.cpp -o obj/account.o

obj/area.o: src/definitions.h src/combined.h src/area.cpp
	$(CC) -c $(FLAGS) src/area.cpp -o obj/area.o

obj/board.o: src/definitions.h src/board.h src/board.cpp
	$(CC) -c $(FLAGS) src/board.cpp -o obj/board.o

obj/character.o: src/definitions.h src/combined.h src/character.cpp
	$(CC) -c $(FLAGS) src/character.cpp -o obj/character.o

obj/command.o: src/definitions.h src/command.h src/command.cpp
	$(CC) -c $(FLAGS) src/command.cpp -o obj/command.o

obj/commands_A-F.o: src/definitions.h src/command.h src/commands_A-F.cpp
	$(CC) -c $(FLAGS) src/commands_A-F.cpp -o obj/commands_A-F.o

obj/commands_G-M.o: src/definitions.h src/command.h src/commands_G-M.cpp
	$(CC) -c $(FLAGS) src/commands_G-M.cpp -o obj/commands_G-M.o

obj/commands_N-P.o: src/definitions.h src/command.h src/commands_N-P.cpp
	$(CC) -c $(FLAGS) src/commands_N-P.cpp -o obj/commands_N-P.o

obj/commands_Q-S.o: src/definitions.h src/command.h src/commands_Q-S.cpp
	$(CC) -c $(FLAGS) src/commands_Q-S.cpp -o obj/commands_Q-S.o

obj/commands_T-Z.o: src/definitions.h src/command.h src/commands_T-Z.cpp
	$(CC) -c $(FLAGS) src/commands_T-Z.cpp -o obj/commands_T-Z.o

obj/commands_aedit.o: src/definitions.h src/command.h src/commands_aedit.cpp
	$(CC) -c $(FLAGS) src/commands_aedit.cpp -o obj/commands_aedit.o

obj/commands_medit.o: src/definitions.h src/command.h src/commands_medit.cpp
	$(CC) -c $(FLAGS) src/commands_medit.cpp -o obj/commands_medit.o

obj/commands_nedit.o: src/definitions.h src/command.h src/commands_nedit.cpp
	$(CC) -c $(FLAGS) src/commands_nedit.cpp -o obj/commands_nedit.o

obj/commands_oedit.o: src/definitions.h src/command.h src/commands_oedit.cpp
	$(CC) -c $(FLAGS) src/commands_oedit.cpp -o obj/commands_oedit.o

obj/commands_pedit.o: src/definitions.h src/command.h src/commands_pedit.cpp
	$(CC) -c $(FLAGS) src/commands_pedit.cpp -o obj/commands_pedit.o

obj/commands_redit.o: src/definitions.h src/command.h src/commands_redit.cpp
	$(CC) -c $(FLAGS) src/commands_redit.cpp -o obj/commands_redit.o

obj/commands_tedit.o: src/definitions.h src/command.h src/commands_tedit.cpp
	$(CC) -c $(FLAGS) src/commands_tedit.cpp -o obj/commands_tedit.o

obj/commandTable.o: src/definitions.h src/commandTable.h src/commandTable.cpp
	$(CC) -c $(FLAGS) src/commandTable.cpp -o obj/commandTable.o

obj/creature.o: src/definitions.h src/combined.h src/creature.cpp
	$(CC) -c $(FLAGS) src/creature.cpp -o obj/creature.o

obj/exit.o: src/definitions.h src/exit.h src/exit.cpp
	$(CC) -c $(FLAGS) src/exit.cpp -o obj/exit.o

obj/help.o: src/definitions.h src/help.h src/help.cpp
	$(CC) -c $(FLAGS) src/help.cpp -o obj/help.o

obj/loginHandler.o: src/definitions.h src/loginHandler.h src/loginHandler.cpp
	$(CC) -c $(FLAGS) src/loginHandler.cpp -o obj/loginHandler.o

obj/log.o: src/definitions.h src/log.h src/log.cpp
	$(CC) -c $(FLAGS) src/log.cpp -o obj/log.o

obj/main.o: src/definitions.h src/main.cpp
	$(CC) -c $(FLAGS) src/main.cpp -o obj/main.o

obj/map.o: src/definitions.h src/map.cpp
	${CC} -c ${FLAGS} src/map.cpp -o obj/map.o

obj/mob.o: src/definitions.h src/combined.h src/mob.cpp
	$(CC) -c $(FLAGS) src/mob.cpp -o obj/mob.o

obj/note.o: src/definitions.h src/note.h src/note.cpp
	$(CC) -c $(FLAGS) src/note.cpp -o obj/note.o

obj/object.o: src/definitions.h src/combined.h src/object.cpp
	$(CC) -c $(FLAGS) src/object.cpp -o obj/object.o

obj/reset.o: src/definitions.h src/reset.h src/reset.cpp
	$(CC) -c $(FLAGS) src/reset.cpp -o obj/reset.o

obj/room.o: src/definitions.h src/combined.h src/room.cpp
	$(CC) -c $(FLAGS) src/room.cpp -o obj/room.o

obj/socket.o: src/definitions.h src/socket.h src/socket.cpp
	$(CC) -c $(FLAGS) src/socket.cpp -o obj/socket.o

obj/stringutil.o: src/definitions.h src/stringutil.h src/stringutil.cpp
	$(CC) -c $(FLAGS) src/stringutil.cpp -o obj/stringutil.o

obj/tEditHandler.o: src/definitions.h src/tEditHandler.h src/tEditHandler.cpp
	$(CC) -c $(FLAGS) src/tEditHandler.cpp -o obj/tEditHandler.o

obj/timer.o: src/definitions.h src/timer.h src/timer.cpp
	$(CC) -c $(FLAGS) src/timer.cpp -o obj/timer.o

obj/timestamp.o: src/definitions.h src/timestamp.h src/timestamp.cpp
	$(CC) -c $(FLAGS) src/timestamp.cpp -o obj/timestamp.o

obj/world.o: src/definitions.h src/world.h src/world.cpp
	$(CC) -c $(FLAGS) src/world.cpp -o obj/world.o

clean:
	rm -rf *~ */*~ */*/*~
	rm -rf obj/*.o
	rm -rf symphony
	chmod -Rf 750 *
